package org.hs.phd.odi.tracking.tracker;

import java.awt.Polygon;
import java.awt.geom.Point2D;

import org.hs.phd.common.improc.traversal.RGBImagePixelTraverser;

public interface TrackWindow extends RGBImagePixelTraverser {
	
	void moveToBestMatchingLocationFor(Polygon initialTrackShape);

	void moveCenterToPosition(Point2D.Float newPosition);

	Polygon getAsPolygon();

	Point2D.Float getCenter();
	
	/**
	 * Example: Consider a 3x3 image, we have indices 0, 1 and 2
	 *    If we use regular centerX = 3/2 = 1.5, 
	 *    then this center is (1.5-0) = 1.5 pixels away from left most pixel,
	 *    but (2 - 1.5) = 0.5 pixels away from the right most pixel
	 *    But if this is centerX, then by definition it has to be the same distance away from both ends!
	 *    if we calculate center as width/2.0 - 0.5, we get same distance to both ends
	 */
	Point2D.Float getGridCenter();

	TrackWindow getCopy();

	float distanceFromCenterTo(float x, float y);

	float normalizedDistanceFromGridCenterTo(float x, float y);


}
